home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozlib15.zoo / sozdistr / include / xdlibs / atari.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-07  |  3.9 KB  |  180 lines

  1. /*
  2.  * sozobon eXtended version headerfile for ATARI TOS bindings
  3.  * you will need this file for os related programs (ACCs using malloc() or
  4.  * Malloc(), TOS version dependant programs, etc.)
  5.  *
  6.  */
  7.  
  8. #ifndef _ATARI_H
  9. #define _ATARI_H
  10.  
  11. /*
  12.  * some useful OS related functions:
  13.  * in extended.lib
  14.  *
  15.  */
  16. #ifndef _BASEP_H
  17. #include    <basepage.h>
  18. #endif
  19.  
  20. extern BASEPAGE *Getbpact_pd();
  21. extern unsigned int    GetTOSvers( long *OS_date, unsigned int *OS_conf,
  22.                                     unsigned int *OS_dosdate);
  23. extern int    Getcookie( long cookie, long *value );
  24.  
  25.  
  26. #ifdef _OSBIND_H
  27. #error "include osbind.h only after including atari.h"
  28. #endif
  29.  
  30. #ifndef _ERRNO_H
  31. #include    <errno.h>
  32. #endif
  33.  
  34.     /* for a fast include define _SYSSTRUC in your source file, and the rest
  35.      *        is skipped.    
  36.      * Maybe we should use a NEED_SYSSTRUC define in the sorcecode, to
  37.      * switch on including the following stuff?
  38.      */
  39. #ifndef _SYSSTRUC
  40. #define    _SYSSTRUC
  41.  
  42.     /* gemdos    */
  43.  
  44. #ifndef _OS_HEADER
  45. #include    <osheader.h>
  46. #endif
  47.  
  48.     /* constants and structs    */
  49.  
  50. #include <file.h>
  51.     /* something for MiNT    */
  52.  
  53. #ifndef SEEK_SET
  54. /* Fseek()  and lseek()  */
  55. #define    SEEK_SET    0        /* from beginning of file */
  56. #define    SEEK_CUR    1        /* from current location */
  57. #define    SEEK_END    2        /* from end of file */
  58. #endif
  59.  
  60.         /* Fopen() modes    */
  61. #define    FO_READ        0x00
  62. #define    FO_RDONLY    0x00
  63. #define    FO_WRITE    0x01
  64. #define    FO_WRONLY    0x01
  65. #define    FO_RANDW    0x02
  66. #define    FO_RDWR        0x02
  67.     /* add sharing modes for file-locking (cookie '_FLK')    */
  68. #define    FO_COMPAT    0x00
  69. #define    FO_DENYRW    0x10    /* deny both, read and write    */
  70. #define    FO_DENYW    0x20
  71. #define    FO_DENYR    0x30
  72. #define    FO_DENYNONE    0x40
  73.     /* lock-inherit flag    */
  74. #define    FO_INHERIT    0x80
  75.  
  76.         /* Fattrib() modes    */
  77. #define    FA_READ        0
  78. #define    FA_WRITE    1
  79.  
  80.     /* file attributes    */
  81. #ifndef FA_NORMAL
  82.         /* only Fcreate()/Fattrib()    */
  83. #define    FA_NORMAL    0x00
  84.         /* Fcreate()/Fattrib()/Fsfirst()/Fsnext()    */
  85. #define FA_RDONLY    0x01
  86. #define FA_HIDDEN    0x02
  87. #define FA_SYSTEM    0x04
  88. #define FA_LABEL    0x08
  89.         /* only Fattrib()/Fsfirst/Fsnext:    */
  90. #define FA_DIREC    0x10
  91. #define FA_DIR        0x10
  92. #define FA_ARCH        0x20
  93. #define FA_CHANGED    0x20
  94. #endif
  95.         /* combinations for Fsfirst()/Fsnext()    */
  96. #define FA_ATTRIB (FA_DIREC|FA_RDONLY|FA_HIDDEN|FA_SYSTEM)
  97. #define FA_FILE (FA_ARCH|FA_RDONLY|FA_HIDDEN|FA_SYSTEM)
  98. #define FA_OTHER (FA_LABEL|FA_DIREC)
  99. /*         usage of Fsfirst():
  100.  * Fsfirst(path, FA_FILE|FA_OTHER)
  101.  *         and test dta->d_attrib:
  102.  * if ( !(dta->d_attrib & FA_OTHER) )
  103.  *             it is an ordinary file    
  104.  * else
  105.  *             label or directory    
  106.  */
  107.     /* struct used by Fsfirst()/Fsnext()/Fgetdta()/Fsetdta()    */
  108. typedef struct Dta {
  109.     char    d_reserved[21];
  110.     char    d_attrib;
  111.     unsigned short    d_time;
  112.     unsigned short    d_date;
  113.     long    d_length;
  114.     char    d_fname[14];
  115. }    DTA;
  116.  
  117.         /* Flock() constants    */
  118. #define    FL_LOCK        0
  119. #define    FL_UNLOCK    1
  120.  
  121.         /* Mxalloc() constants    */
  122. #define    MX_STONLY    0
  123. #define    MX_ALTONLY    1
  124. #define    MX_PREFST    2
  125. #define    MX_PREFALT    3
  126.  
  127.     /* struct filled by Dfree()    */
  128. typedef struct Diskinfo {
  129.     long    b_free;
  130.     long    b_total;
  131.     long    b_secsiz;
  132.     long    b_clsiz;
  133. } DISKINFO;
  134.  
  135.     /* Fdatime() constants    */
  136. #define    FD_READ        0
  137. #define    FD_WRITE    1
  138.     /* struct filled/used by Fdatime()    */
  139. typedef struct Dostime {
  140.   unsigned short time;
  141.   unsigned short date;
  142. } DOSTIME;
  143.  
  144.     /* Pexec() modes    */
  145. #define    PE_LOADGO        0    /* load & go */
  146. #define    PE_LOAD            3    /* just load */
  147. #define    PE_GO            4    /* just go (env & TPA owned by parent) */
  148. #define    PE_CBASEPAGE    5    /* just create basepage */
  149. #define    PE_GO_FREE        6    /* just go, then free  */
  150. #define    PE_CBASEP_PRGFLAGS    7    /* create basepage, respecting prgflags */
  151.  
  152.  
  153.     /* bios    - for more structures, see bios.h    */
  154.  
  155.     /* Device codes for Bconin(), Bconout(), Bcostat(), Bconstat() */
  156. #define _PRT    0
  157. #define _AUX    1
  158. #define _CON    2
  159. #define _MIDI   3
  160. #define _IKBD   4
  161. #define _RAWCON 5
  162.  
  163.     /* xbios    */
  164.  
  165. typedef struct Keytab {
  166.     char *unshift;
  167.     char *shift;
  168.     char *capslock;
  169. } KEYTAB;
  170.  
  171.     /* if you wite OS related Programs you will need an osbind.h
  172.         include:    
  173.      */
  174.  
  175. #include <osbind.h>
  176.  
  177. #endif    /* _SYSSTRUC    */
  178.  
  179. #endif    /* _ATARI_H    */
  180.